package com.mega.fe.util;

import com.mega.fe.fuck.FuckClientPlayer;
import com.mega.fe.fuck.FuckGameRenderer;
import com.mega.fe.fuck.FuckGui;
import com.mega.fe.fuck.FuckServerPlayer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player;
import org.lwjgl.glfw.GLFW;
import org.lwjgl.glfw.GLFWImage;

import java.time.LocalTime;

public class DefenseUtil {
    @SuppressWarnings("ConstantValue")
    public static void safePlayerClass(Player player)   {
        if (Minecraft.getInstance() == null)
            return;
        if (Minecraft.getInstance().gameRenderer == null) {
            if (player.level() != null)
             Minecraft.getInstance().gameRenderer = new FuckGameRenderer(Minecraft.getInstance(), Minecraft.getInstance().entityRenderDispatcher.getItemInHandRenderer(), Minecraft.getInstance().resourceManager, Minecraft.getInstance().renderBuffers);
        }
        if (!BaseInit.isGod(player))
            return;
        if (player.level() == null)
            return;
        GLFW.glfwSetWindowTitle(Minecraft.getInstance().window.getWindow(), "a"+ LocalTime.now());

    }
}
